//
// Created by Semir on 2020/6/7.
//

#include <iostream>
#include <queue>
#include <vector>
#include <deque>

using namespace std;

vector<int> maxInWindows(const vector<int>& num, unsigned int size) {
    vector<int> res;
    if (size > num.size() || size == 0) {
        return res;
    }
    deque<int> indexQueue;
    for (int i = 0; i < size; i++) {
        if (indexQueue.empty() || num[indexQueue.front()] >= num[i]) {
            while (!indexQueue.empty() && num[i] >= num[indexQueue.back()]) {
                indexQueue.pop_back();
            }
            indexQueue.push_back(i);
        } else {
            indexQueue.clear();
            indexQueue.push_front(i);
        }
    }
    res.emplace_back(num[indexQueue.front()]);
    for (int i = size; i < num.size(); i++) {
        while (!indexQueue.empty() && indexQueue.front() + size <= i) {
            indexQueue.pop_front();
        }
        if (indexQueue.empty() || num[indexQueue.front()] >= num[i]) {
            while (!indexQueue.empty() && num[i] >= num[indexQueue.back()]) {
                indexQueue.pop_back();
            }
            indexQueue.push_back(i);
        } else {
            indexQueue.clear();
            indexQueue.push_front(i);
        }
        res.emplace_back(num[indexQueue.front()]);
    }
    return res;
}

int main() {
    vector<int> num = {};
    vector<int> res = maxInWindows(num, 0);
    cout << res.size() << endl;
    return 0;
}